package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.base.domain.mysql.gateway.other.DigitalKey;
import com.glsc.ngateway.common.api.platform.dto.other.DigitalKeyDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;


/**
 * @Author: libj
 * @Date: 2022/6/27
 * @Desc: domin到dto转换
 */
@Mapper(componentModel = "spring")
public interface DigitalKeyMapper {
    DigitalKeyMapper INSTANCE = Mappers.getMapper(DigitalKeyMapper.class);

    //20221208,zzp,临时增加，魏子腾请核对
    @Mapping(target = "keyClass", ignore = true)
    @Mapping(target = "custodianList", ignore = true)
    @Mapping(target = "custodianNameList", ignore = true)
    @Mapping(target = "custodianDeptId", ignore = true)
    @Mapping(target = "canEdit", ignore = true)
    @Mapping(target = "custodianListTrue", ignore = true)
    @Mapping(target = "custodianNameListTrue", ignore = true)
    DigitalKeyDto domain2dto(DigitalKey domain);

    List<DigitalKeyDto> domain2dto(List<DigitalKey> domain);

    DigitalKey dto2domain(DigitalKeyDto dto);

    List<DigitalKey> dto2domain(List<DigitalKeyDto> dto);
}
